/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO

Authors: Nitay Megides
		 Rachel Banino

Project: Exercise 1

Using: LinkedList.h
	   General.h
	   Hw1Types.h

Description:
A List, based on LinkedList, that contains and manages the different 
product types. Each list node has a pointer to TProduct, which contains the 
inforamtion about the relevant product
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#ifndef PRODUCT_LIST_H
#define PRODUCT_LIST_H

#include "General.h"
#include "LinkedList.h"
#include "Hw1Types.h"


/*
 * TProduct - Represents a product
 */
typedef struct 
{
    int ID;
	char Name[MAX_NAME_LEN];
} TProduct;
typedef TProduct* PProduct;


/**
 * Initializes the product list. MUST BE CALLED PRIOR TO USING THIS MODULE
 * Returns TRUE on succress, FALSE on failure
 */ 
BOOL InitializeProductList();

/**
 * Adds a new product to the list with product id = ID, and name = Name
 * Returns TRUE on succress, FALSE on failure
 */ 
BOOL AddProduct(const TProductID ID, const char* Name);

/**
 * Returns a product with an id as ID. If no product is found, returns NULL
 */ 
PProduct GetProduct(const TProductID ID);

/**
 * Frees the resources taken by this module
 */ 
void FreeProductList();

#endif // PRODUCT_LIST_H